// A-S-M team
// Project: BattleCity
// Created: 28.03.2011
// Last change: 28.03.2011
// Description: 

#include "menu.h"
#include "game.h"

bool Menu::update(int dt)
{
	/*if (Keyboard::getInstance()->getPressedNotProcessed(CL_KEY_ENTER))
		Game::getInstance()->setGameState(Game::GS_PLAY);

	// exit from game
	if (Keyboard::getInstance()->getPressedNotProcessed(CL_KEY_ESCAPE))
		return false;*/

	draw();
	return true;
}

void Menu::draw()
{
	Painter::getInstance()->clear();
	Painter::getInstance()->drawText(ORIGINAL_SCREEN_WIDTH / 2, ORIGINAL_SCREEN_HEIGHT / 2, "This is menu!\n Press <Enter> for play");
}

void Menu::keyUp(int key)
{
//
}

void Menu::keyDown(int key)
{
	switch(key)
	{
		case CL_KEY_ENTER:
			Game::getInstance()->setGameState(Game::GS_PLAY);
			break;

		case CL_KEY_ESCAPE:
			Game::getInstance()->exit();
			break;
				
		default:
			return;
			break;
	}
}

void Menu::keyPress(int key)
{
	//
}